package com.alex.designPattern.strategy;

import com.alex.designPattern.AbstractDao;
import com.alex.designPattern.DaoType;
import com.alex.designPattern.HibernateDao;
import com.alex.designPattern.IbatitsDao;

/**
 * @author alex
 *
 */
public class StrategyFactory {
	
	private AbstractDao dao;
	
	public StrategyFactory(DaoType type){
		if(type != null){
			switch(type){
				case HIBERNATE : 
					dao = new HibernateDao();
					break;
				case IBATITS : 
					dao = new IbatitsDao();
					break;
			}
		}
	}
	
	public Object getObject(){
		return dao.getById();
	}
}
